package iss.team2.lams.dao;

import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.List;

import javax.sql.DataSource;

import iss.team2.lams.model.PublicHoliday;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.jdbc.core.RowMapper;

public class PublicHolidayDAOImpl extends LDAO implements PublicHolidayDao ,RowMapper<PublicHoliday>
{
	@Autowired
	DataSource dataSource;
	
	

	public PublicHolidayDAOImpl() 
	{
		table="public_holiday";
	}

	@Override
	public PublicHoliday mapRow(ResultSet arg0, int arg1) throws SQLException {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public void create(PublicHoliday ph) 
	{
		query="insert into "+table+" values(?,?,?)";
		jtempl=new JdbcTemplate(dataSource);
		jtempl.update(query, ph.getPhId(), ph.getDate(),ph.getDescription());
		
		// TODO Auto-generated method stub
		
	}

	@Override
	public List<PublicHoliday> listPublicHoliday() {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public void delete(String phid) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public PublicHoliday update(PublicHoliday ph) {
		// TODO Auto-generated method stub
		return null;
	}

}
